package com.mail.server.service;

import com.mail.dubbo.api.OrderApi;
import com.mail.dubbo.api.OrderSettingApi;
import com.mail.model.db.OmsOrderSetting;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

@Service
public class OrderSettingService {

    @DubboReference
    private OrderApi orderApi;

    @DubboReference
    private OrderSettingApi orderSettingApi;

    //修改指定订单设置
    public Integer update(Integer id, OmsOrderSetting orderSetting) {
        //1、调用API，修改指定订单设置
        orderSetting.setId(id.longValue());
        return orderSettingApi.update(orderSetting);
    }

    //获取指定订单设置
    public OmsOrderSetting findById(Integer id) {
        return orderSettingApi.findById(id.longValue());
    }
}
